package cn.itcast.batch.task;

import cn.itcast.batch.AnalysisDataRate;
import cn.itcast.batch.utils.DateUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


public class TotalWeekRateTask {
    private static final Logger logger = LoggerFactory.getLogger(TotalWeekRateTask.class);

    public static void main(String[] args) {
        /**
         * 1.获取周开始时间
         * 2.实例化AnalysisDataRate对象
         * 3.运行任务
         */
        String week = DateUtil.getNowWeekStart();
        AnalysisDataRate dataRate = new AnalysisDataRate(week);
        logger.info("按照天计算数据准确率："+dataRate);
        long time = System.currentTimeMillis();
        dataRate.executeTask();
        logger.info("TotalWeekRateTask 作业运行结束,运行话费时间："+(System.currentTimeMillis()-time)+"毫秒");
    }
}
